import sys
def convert_to_3f(val):
	val=str(val)
	if len(val)==1:
		val="U00"+val
	if len(val)==2:
		val="U0"+val
	if len(val)==3:
		val="U"+val
	return val
fileIn=open(sys.argv[1])
fileOut=open(sys.argv[2],'w')
count=0
line=fileIn.readline()
spl=line.strip().split("\t")
#print spl
features=len(spl)
fileOut.write("# Unigram\n")
for i in range(0, features-1):
	#U26:%x[0,26]/%x[0,29]
	#fileOut.write(convert_to_3f(i)+":%x[0,"+str(i)+"]/%x[0,"+str(features-1)+"]\n")
	fileOut.write(convert_to_3f(i)+":%x[0,"+str(i)+"]\n")#/%x[0,"+str(features-1)+"]\n")

#fileOut.write(convert_to_3f(features-1)+":%x[-1,"+str(features-1)+"]/%x[0,"+str(features-1)+"]\n")
#fileOut.write(convert_to_3f(features)+":%x[-2,"+str(features-1)+"]/%x[0,"+str(features-1)+"]\n")
fileOut.write("\n\n# Bigram\nB\n")
fileOut.close()
fileIn.close()
